﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CharacterSystem;
using SkillSystem;
using UnityEngine;

public class Monster:CharacterBase, ISkillReceiver,IReduceHPAble
{
    SkillReceiverBase receiver;

    public GameObject targetGo;

    MonsterAI ai;
    private void Start()
    {
        receiver = new SkillReceiverBase(this);

        navicate = new NavigateMesh(this.gameObject);
    }

    private void Update()
    {
        ai.Update();
    }

    public void ReceiverSkillItem(SkillItem skillItem)
    {
        Debug.Log("This Obj Get Skill !It's Id is " + skillItem.CurSkillItemData.ID);
        receiver.ReceiverSkillItem(skillItem);
    }

    public void ReduceHP(float value)
    {
        Debug.Log("Reduce HP" + value);
        ai.CurState = MonsterState.Dead;
    }

    public Monster()
    {
        ai = new MonsterAI(this);
    }
}